/****************************************************************/
/*                        Instruction                           */
/* This is the Material applying the necessary parameters      */
/* to simulate heat conduction and pyrolysis progress .         */
/* the pyrolysis model is single-phase Arrhenius relation(pyrolysis area,not surface model) .         */
/* the first version did not include pyrolysis gas properties(created at 2017.04.21)*/


#pragma once

#include "Material.h"
#include "LinearInterpolation.h"

class Function;

class SinglePhasePyrolysisMaterial : public Material
{
public:
	SinglePhasePyrolysisMaterial(const InputParameters & parameters);

protected:

  Real Source(Real rho, Real T, Real T_begin, Real rhoc, Real rhov, Real precoff, Real ER, Real reaction_level);
  virtual void computeProperties();
   std::string _rho_name;
   MaterialProperty<Real> & _T_begin;
   MaterialProperty<Real> & _precofficient;
   MaterialProperty<Real> & _ER;
   MaterialProperty<Real> & _reaction_level;
   MaterialProperty<Real> & _rhov_i;
   MaterialProperty<Real> & _rhoc_i;
   MaterialProperty<Real> & _rho_i;
   MaterialProperty<Real> & _pyrolysis_source;
   MaterialProperty<Real> & _dsource_drho;
   MaterialProperty<Real> & _dsource_dT;//去掉了propertypack的设定，为了使物性参数更容易输出查看
  //get varialbles
  const VariableValue  & _T_value;
  const VariableGradient &  _gradient_T_value;
  const VariableValue &   _rho_value;
  const VariableValue &  _rho_dt_value;
  const VariableValue &  _rhodot_drho_value;
  //get Regular thermal properties
  Real  _rho_i_v_value;
  Real  _rho_i_c_value;
  //get special parameters to compute pyrolysis Arrhenius relation
  Real  _T_begin_value;
  Real  _precoff_value;
  Real  _ER_value;
  Real  _reaction_level_value;
};

template<>
InputParameters validParams<SinglePhasePyrolysisMaterial>();
